import 'package:library_base/entities/generated/json/base/json_convert_content.dart';
import 'package:library_base/entities/summary_child_entity.dart';
import 'package:library_base/entities/summary_entity.dart';

SummaryEntity $SummaryEntityFromJson(Map<String, dynamic> json) {
  final SummaryEntity loginBeanEntity = SummaryEntity();

  final List<SummaryChildEntity> orderDetails =
      jsonConvert.convertList<SummaryChildEntity>(json['orderDetails']);
  loginBeanEntity.orderDetails = orderDetails;

  final String? shipperId = jsonConvert.convert<String>(json['shipperId']);
  if (shipperId != null) {
    loginBeanEntity.shipperId = shipperId;
  }
  final String? shipperName = jsonConvert.convert<String>(json['shipperName']);
  if (shipperName != null) {
    loginBeanEntity.shipperName = shipperName;
  }
  final String? goodsCode = jsonConvert.convert<String>(json['goodsCode']);
  if (goodsCode != null) {
    loginBeanEntity.goodsCode = goodsCode;
  }
  final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
  if (goodsName != null) {
    loginBeanEntity.goodsName = goodsName;
  }
  final String? goodsUnit = jsonConvert.convert<String>(json['goodsUnit']);
  if (goodsUnit != null) {
    loginBeanEntity.goodsUnit = goodsUnit;
  }
  final double? totalCount = jsonConvert.convert<double>(json['totalCount']);
  loginBeanEntity.totalCount = totalCount ?? 0;

  final double? standardWeight = jsonConvert.convert<double>(json['standardWeight']);
  loginBeanEntity.standardWeight = standardWeight ?? 0;


  return loginBeanEntity;
}

Map<String, dynamic> $SummaryEntityToJson(SummaryEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['shipperId'] = entity.shipperId;
  data['shipperName'] = entity.shipperName;
  data['goodsCode'] = entity.goodsCode;
  data['goodsName'] = entity.goodsName;
  data['goodsUnit'] = entity.goodsUnit;
  data['orderDetails'] = entity.orderDetails;
  return data;
}
